package com.meilai.project.controller.web.market.vo;

import com.meilai.project.controller.web.market.entity.BillMarketShootRequirement;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.format.DateTimeFormatter;

/**
 * @author 张驰
 * @description 市场单-拍照要求
 * @date 2023-03-30 16:52
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class BillMarketShootRequirementForExportVO extends BillMarketShootRequirement {
    /**
     * 媒体类型id
     */
    private Long media_type_id;

    public String description() {
        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("M.d");
        String result = "";
        if (null != getShoot_date()) {
            result += getShoot_date().format(dateTimeFormatter) + "";
        }

        if (null != getClose_shoot_num() && getClose_shoot_num() > 0) {
            result += "，近景" + getClose_shoot_num() + "张";
        }
        if (null != getFar_shoot_num() && getFar_shoot_num() > 0) {
            result += "，远景" + getFar_shoot_num() + "张";
        }
        if (null != getWatermark_time() && getWatermark_time()) {
            result += "，有水印时间";
        }
        if (null != getBaidu_time() && getBaidu_time()) {
            result += "，有百度时间";
        }
        if (null != getNewspaper_time() && getNewspaper_time()) {
            result += "，有报纸时间";
        }
        if (null != getNormal_shoot() && getNormal_shoot()) {
            result += "，正常拍摄";
        }

        if (null != getBackground_clear() && getBackground_clear()) {
            result += "，背景清晰";
        }

        if (null != getNewpaper_clear() && getNewpaper_clear()) {
            result += "，报纸清晰";
        }
        // 加上备注信息
        if (null != getMemo() && !getMemo().isEmpty()){
            result += "，" + getMemo();
        }

        return result + "；";
    }
}
